{% extends 'base.html'%}
{% load i18n %} 
{% block menutab %}
<div class="menutab"><a href="/">{% trans 'All topic' %}</a></div>
<div class="menutab"><a href="/member/">{% trans 'My home page' %}</a></div>
<div class="menutab"><a href="/mail/inbox/">{% trans 'Inbox' %}</a></div>
<div class="menutab currenttab"><a href="/mail/sendbox/">{% trans 'Sendbox' %}</a></div>
{% endblock %}
{% block main %}


<div id="MailBoxWrap">
	{% for mail in mails.object_list %}
	<div class="mail-wrap {% cycle odd,even %}">
		<div class="mail-meta">
			<div class="mail-sender">
				<div class="sendto-span">{% trans 'Send to' %} : </div>
				<div class="sender-name">
					<a href="/member/{{ mail.recipient.username}}">{{ mail.recipient.get_profile.realname }}</a>
				</div>
				<div class="sender-protrait">
					<a href="/member/{{ mail.recipient.username}}">
						<img class="box-shadow small-protrait" src="{{mail.recipient.get_profile.gen_protrait}}" width="15" height="15" />
					</a>
				</div>
				<div class="mail-datetime">{% trans 'Posted time' %} : {{ mail.created|date:"Y-m-d H:i:s"}}</div>
			</div>
			<div class="mail-control">
				<a href="/mail/mailto/{{mail.user.id}}/"><span class="mail-reply-btn"></span></a>
				<a href="/mail/delete/{{mail.id}}/?go=/mail/sendbox/"><span class="mail-delete-btn"></span></a>
			</div>
			<div class="clearblank"></div>
		</div>
		<div class="mail-content-wrap">
			<div class="mail-content">
				{{ mail.content}}
			</div>
		</div>
	</div>
	{% empty %}
	<div class="no-topic">
		<h4>{% trans 'No mail be sent' %}</h4>
	</div>
	{% endfor %}
</div>

{% if paginator.count > paginator.per_page %}
<div class="pagination">
	<span class="step-links">
		{% if mails.has_previous %}
			<span class="prev round-corner-button"><a href="?page={{ mails.previous_page_number }}">{% trans 'PREV' %}</a></span>
		{% endif %}

		<span class="current round-corner-button">
			{% trans 'PAGE' %} {{ mails.number }}/{{ mails.paginator.num_pages }}
		</span>

		{% if mails.has_next %}
			<span class="next round-corner-button"><a href="?page={{ mails.next_page_number }}">{% trans 'NEXT' %}</a></span>
		{% endif %}
	</span>
</div>
{% endif %}

{% endblock %}